﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework;
using Krist_em_up.Interface;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Net;

namespace Krist_em_up.Network
{
    class CreateOrFindSession : GameScreen
    {

        List<Button> buttons;

        public CreateOrFindSession(GameStateManager g) : base(g)
        {
            //buttons = new List<Button>();
            //Button b = new Button(Vector2.Zero, "Create");
            //b.Selected += new EventHandler<EventArgs>(CreateSelected);
        }

        public override void Update(GameTime gameTime)
        {
            
        }

        public override void Draw(GameTime gameTime)
        {
            
        }

        public override void LoadContent()
        {
            
        }

        public override void UnloadContent()
        {
            
        }

        public override void Initialize()
        {
            
        }

        public override void Reset()
        {
            
        }

        //void CreateSelected(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        // Which local profiles should we include in this session?
        //        //IEnumerable<SignedInGamer> localGamers = 
        //        SignedInGamer g = Gamer.SignedInGamers[0];
        //        NetworkGamer g = new NetworkGamer();
        //        // Begin an asynchronous create network session operation.
        //        IAsyncResult asyncResult = NetworkSession.BeginCreate(
        //                                            sessionType, localGamers,
        //                                            NetworkSessionComponent.MaxGamers,
        //                                            0, null, null, null);

        //        // Activate the network busy screen, which will display
        //        // an animation until this operation has completed.
        //        NetworkBusyScreen busyScreen = new NetworkBusyScreen(asyncResult);

        //        busyScreen.OperationCompleted += CreateSessionOperationCompleted;

        //        ScreenManager.AddScreen(busyScreen, ControllingPlayer);
        //    }
        //    catch (Exception exception)
        //    {                

        //    }
        //}

        //void CreateSessionOperationCompleted(object sender, EventArgs e)
        //{
        //    //NetworkSession networkSession = NetworkSession.EndCreate(e.AsyncResult);
        //}
    }
}
